package com.terrace.db.system.mapper.entity;

import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.terrace.core.utils.enums.RegexType;
import com.terrace.core.utils.validation.annotation.FieldValid;

/**
 * 用户权限表
 * 
 * @author jiangyg
 *
 */
public class Permission implements Serializable {

	private static final long serialVersionUID = -5873562742140366226L;

	private String id;

	/**
	 * 权限名称
	 */
	private String permiName;

	/**
	 * 权限编码
	 */
	private String permiCode;

	/**
	 * 权限描述
	 */
	private String permiDepict;

	/**
	 * 权限类型 1、导航栏 2、菜单 3、按钮
	 */
	private String permiType;

	/**
	 * 权限排序
	 */
	private Integer permiOrder;

	/**
	 * 权限访问URL
	 */
	private String permiUrl;

	/**
	 * 权限图标
	 */
	private String permiIcon;

	/**
	 * 父级权限ID--有时需要用到ID
	 */
	private String parentPermiId;

	/**
	 * 父级权限
	 */
	private Permission parentPermi;
	
	/**
	 * 子集权限
	 */
	private List<Permission> childrenPermis;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id == null ? null : id.trim();
	}

	@FieldValid(depict = "权限名称", nullable = false)
	public String getPermiName() {
		return permiName;
	}

	public void setPermiName(String permiName) {
		this.permiName = permiName == null ? null : permiName.trim();
	}

	public String getPermiCode() {
		return permiCode;
	}

	public void setPermiCode(String permiCode) {
		this.permiCode = permiCode == null ? null : permiCode.trim();
	}

	public String getPermiDepict() {
		return permiDepict;
	}

	public void setPermiDepict(String permiDepict) {
		this.permiDepict = permiDepict == null ? null : permiDepict.trim();
	}

	@FieldValid(depict = "权限类型", nullable = false)
	public String getPermiType() {
		return permiType;
	}

	public void setPermiType(String permiType) {
		this.permiType = permiType == null ? null : permiType.trim();
	}

	@FieldValid(depict = "权限排序", regexType = RegexType.INTEGER)
	public Integer getPermiOrder() {
		return permiOrder;
	}

	public void setPermiOrder(Integer permiOrder) {
		this.permiOrder = permiOrder;
	}

	public String getPermiUrl() {
		return permiUrl;
	}

	public void setPermiUrl(String permiUrl) {
		this.permiUrl = permiUrl == null ? null : permiUrl.trim();
	}

	public String getPermiIcon() {
		return permiIcon;
	}

	public void setPermiIcon(String permiIcon) {
		this.permiIcon = permiIcon == null ? null : permiIcon.trim();
	}

	public String getParentPermiId() {
		return parentPermiId;
	}

	public void setParentPermiId(String parentPermiId) {
		this.parentPermiId = parentPermiId;
	}

	@JsonIgnore
	public Permission getParentPermi() {
		return parentPermi;
	}

	public void setParentPermi(Permission parentPermi) {
		this.parentPermi = parentPermi;
	}

	@JsonIgnore
	public List<Permission> getChildrenPermis() {
		return childrenPermis;
	}

	public void setChildrenPermis(List<Permission> childrenPermis) {
		this.childrenPermis = childrenPermis;
	}

}